import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Index from "../views/Index";
import Function from "../views/Function";
import Role from "../views/Role";
import User from "../views/User";
import UploadTest from "../views/UploadTest";
import Goods from "../views/Goods";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  // {
  //   path: '/',
  //   name: 'UploadTest',
  //   component: UploadTest
  // },
  {
    path: '/index',
    name: 'Index',
    component: Index,
    children:[
      {
        path:'/function',
        name:'Function',
        component: Function
      },
      {
        path:'/role',
        name:'Role',
        component: Role
      },
      {
        path:'/user',
        name:'User',
        component: User
      },
      {
        path:'/goods',
        name:'Goods',
        component: Goods
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
